<?php
namespace Admin\Controller;
use Think\Controller;
class CommonController extends Controller {
    
    public function _initialize()
    {
      $path = MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME;

      $aid = $_SESSION['aid'];



      $auth=new \Think\Auth();

      
      if(!$auth->check($path,$aid)){
          if(IS_AJAX){

            $this->ajaxReturn(['error'=>2,'info'=>'你没权限操作']);

          }else{

            $this->error('你没权限操作',U('home/login/index'));

          }
      }

    }
}